package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * SpecPrice entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_SPEC_PRICE", schema = "MXZ")
public class SpecPrice extends Entity implements java.io.Serializable {

	// Fields

	private Long specPriceId;
	private StoreGoods storeGoods;
	private String key;
	private String names;
	private Integer price;
	private Float stock;
	private Long updateTime;

	// Constructors

	/** default constructor */
	public SpecPrice() {
	}

	/** full constructor */
	public SpecPrice(StoreGoods storeGoods, String key, String names,
			Integer price, Float stock, Long updateTime) {
		this.storeGoods = storeGoods;
		this.key = key;
		this.names = names;
		this.price = price;
		this.stock = stock;
		this.updateTime = updateTime;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_SPEC_PRICE")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "SPEC_PRICE_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getSpecPriceId() {
		return this.specPriceId;
	}

	public void setSpecPriceId(Long specPriceId) {
		this.specPriceId = specPriceId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_GOODS_ID", nullable = false)
	public StoreGoods getStoreGoods() {
		return this.storeGoods;
	}

	public void setStoreGoods(StoreGoods storeGoods) {
		this.storeGoods = storeGoods;
	}

	@Column(name = "KEY", nullable = false, length = 50)
	public String getKey() {
		return this.key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	@Column(name = "NAMES", nullable = false, length = 100)
	public String getNames() {
		return this.names;
	}

	public void setNames(String names) {
		this.names = names;
	}

	@Column(name = "PRICE", nullable = false, precision = 8, scale = 0)
	public Integer getPrice() {
		return this.price;
	}

	public void setPrice(Integer price) {
		this.price = price;
	}

	@Column(name = "STOCK", nullable = false, precision = 8, scale = 1)
	public Float getStock() {
		return this.stock;
	}

	public void setStock(Float stock) {
		this.stock = stock;
	}

	@Column(name = "UPDATE_TIME", nullable = false, precision = 15, scale = 0)
	public Long getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Long updateTime) {
		this.updateTime = updateTime;
	}

}